import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 帅小伙
 * @date 2022/1/2
 * @description
 */
public class Task05 {

    private static final String EXCHANGE_NAME = "direct_logs";

    public static void main(String[] args) throws Exception {
        Channel channel = RabbitMqUtils.getChannel();
        channel.exchangeDeclare(EXCHANGE_NAME, BuiltinExchangeType.DIRECT);

        Map<String,String> bindingKeyMap = new HashMap<String,String>();
        bindingKeyMap.put("info","普通消息");
        bindingKeyMap.put("waring","警告消息");
        bindingKeyMap.put("error","错误消息");
        bindingKeyMap.put("debug","调试消息");
        for (Map.Entry<String, String> entry :  bindingKeyMap.entrySet()) {
            channel.basicPublish(EXCHANGE_NAME,entry.getKey(),null, entry.getValue().getBytes());
        }




    }


}
